package com.hbnu.like.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hbnu.like.mapper.LikeMapper;
import com.hbnu.like.domain.Like;
import com.hbnu.like.service.ILikeService;

/**
 * 点赞表Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-28
 */
@Service
public class LikeServiceImpl implements ILikeService 
{
    @Autowired
    private LikeMapper likeMapper;

    /**
     * 查询点赞表
     * 
     * @param userId 点赞表主键
     * @return 点赞表
     */
    @Override
    public Like selectLikeByUserId(Long userId)
    {
        return likeMapper.selectLikeByUserId(userId);
    }

    /**
     * 查询点赞表列表
     * 
     * @param like 点赞表
     * @return 点赞表
     */
    @Override
    public List<Like> selectLikeList(Like like)
    {
        return likeMapper.selectLikeList(like);
    }

    /**
     * 新增点赞表
     * 
     * @param like 点赞表
     * @return 结果
     */
    @Override
    public int insertLike(Like like)
    {
        return likeMapper.insertLike(like);
    }

    /**
     * 修改点赞表
     * 
     * @param like 点赞表
     * @return 结果
     */
    @Override
    public int updateLike(Like like)
    {
        return likeMapper.updateLike(like);
    }

    /**
     * 批量删除点赞表
     * 
     * @param userIds 需要删除的点赞表主键
     * @return 结果
     */
    @Override
    public int deleteLikeByUserIds(Long[] userIds)
    {
        return likeMapper.deleteLikeByUserIds(userIds);
    }

    /**
     * 删除点赞表信息
     * 
     * @param userId 点赞表主键
     * @return 结果
     */
    @Override
    public int deleteLikeByUserId(Long userId)
    {
        return likeMapper.deleteLikeByUserId(userId);
    }
}
